#include <linux/console.h>
#include <riscv/sbi.h>

static void con_write(struct console *co, const char *s, unsigned int count)
{
    for (int i = 0; i < count; i++)
    {
        sbi_console_putchar(s[i]);
    }
}

static struct console bootcon = {
    .flags = CON_BOOT,
    .write = con_write,
};

void bootcon_sbi_init(void)
{
    register_console(&bootcon);
}
